//
//  GMString.m
//  mastergolf
//
//  Created by wujungao on 15/7/24.
//  Copyright (c) 2015年 Master. All rights reserved.
//

#import "GMString.h"

@implementation NSString (GMString)

+(BOOL)isEmptyString:(NSString *)string{
    
    if(([string isKindOfClass:[NSNull class]]) || (string == nil) || (string == NULL) || ([string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].length==0)){
        
        return YES;
    
    }else{
    
        return NO;
    }
}

-(NSString *)removeAllBlankAndNewlineCharacter:(NSString *)string{
    
    NSString *newString=[[[[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] stringByReplacingOccurrencesOfString:@"\r" withString:@""] stringByReplacingOccurrencesOfString:@"\n" withString:@""] stringByReplacingOccurrencesOfString:@" " withString:@""];
    
    return newString;
}

@end
